Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
"WebSocket connection to 'wss://mydomain.com:8080/' failed:" with no extra details

I am trying to host a websocket using node.js and it seems to host fine, but I cannot connect to it externally because I just get the error in the title. The : after failed suggests there should be extra details and similar questions here prove that, but I'm not getting anything after the colon making this very difficult to debug. I have tried in multiple browsers and I get the same error so it's not my browser causing this. My best guess would be that my cerificates aren't working, but they're the same certificates I use for the rest of my websites and they work fine for them so not too sure.

This is my server-side (node.js) code:

const server = require('https').createServer({
    cert: fs.readFileSync('/etc/letsencrypt/live/mydomain.com/fullchain.pem'),
    key: fs.readFileSync('/etc/letsencrypt/live/mydomain.com/privkey.pem')
});

const websocket = new (require('ws').Server)({server});
websocket.on('connection', (client, request) => {
    console.log("New connection from "+request.socket.remoteAddress);
});

And my client-side (Javascript) code is just

new WebSocket("wss://mydomain.com:8080").onmessage = (event) => {
    console.log(event.data);
};

I have tried making my node.js server listen to port 8080 but that made no difference. I have also tried different URLs on the client side (such as without the protocol, without the port, using my ip) but as I would expect, those don't work either.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!